<!-- 创建项目 -->
<template lang="html">
  <Card v-if='hackReset' :bordered="false">
    <p slot="title">创建项目</p>
    <Form ref="form" :model="info" :rules="rules">
      <table id="createProgram" ref="print" width='100%' border="1" cellspacing="0" cellpadding="0">
        <tr>
          <th colspan="4">项目基本信息表</th>
        </tr>
        <tr>
          <td width="25%">
            <Icon v-show="isCustomInput" type="ios-medical" color="#ff6868" />
            项目编号
          </td>
          <td style='fontSize:12px;color:#666' v-if='!isCustomInput' colspan="3">{{info.ProjectNumber}}</td>
          <td v-if='isCustomInput' colspan="3">
            <FormItem prop="ProjectNumber">
              <Input v-model="info.ProjectNumber" :disabled='viewOnly'></Input>
            </FormItem>
          </td>
        </tr>
        <tr>
          <td width="25%">
          <Icon type="ios-medical" color="#ff6868" />
            项目名称
          </td>
          <td colspan="3">
            <FormItem prop="ProjectName">
              <Input v-model.trim="info.ProjectName" :disabled='viewOnly'></Input>
            </FormItem>
            <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'projectName')" v-if='projectNameList.length>0'/>
            <Oldname v-if="projectName" :oldName="projectNameList"></Oldname>
          </td>
        </tr>
        <tr>
          <td width="25%">
            <Icon type="ios-medical" color="#ff6868" />
            建设单位
          </td>

          <td colspan="3">
            <FormItem prop="BuildUnit">
              <Input type='textarea' :autosize="true" v-model="info.BuildUnit" :disabled='viewOnly'></Input>
            </FormItem>
            <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'buildName')" v-if='buildNameList.length>0'/>
            <Oldname v-if="buildName" :oldName="buildNameList"></Oldname>
            <!-- <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick" v-if='pt2List.length>0'/>
            <Oldname v-if="pt2List.length>0" :oldName="pt2List"></Oldname> -->
          </td>
        </tr>
        <tr>
          <td width="25%">
            法人
          </td>
          <td width="25%">
            <Input v-model="info.LegalPerson" :disabled='viewOnly'></Input>
            <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'LegalPerson')" v-if='LegalPersonList.length>0'/>
            <Oldname v-if="LegalPerson" :oldName="LegalPersonList"></Oldname>
          </td>
          <td width="25%">
            <Icon type="ios-medical" color="#ff6868" />
            联系人
          </td>
          <td>
            <FormItem prop="Linkman">
              <Input v-model="info.Linkman" :disabled='viewOnly'></Input>
            </FormItem>
            <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'Linkman')" v-if='LinkmanList.length>0'/>
            <Oldname v-if="Linkman" :oldName="LinkmanList"></Oldname>
          </td>
        </tr>
        <tr>
          <td width="25%">
            通讯地址
          </td>
          <td colspan="3">
            <Row>
              <Col span="4">
              <!-- 省 -->
              <Select v-model="MailingAddress.sheng" @on-change="shengIndex(MailingAddress.sheng)" placeholder="请选择省" :disabled='viewOnly'>
                <Option v-for="(item, index) in MailingAddress.selectsheng" :key="index" :value="item.name">
                  {{item.name}}
                </Option>
              </Select>
              </Col>
              <Col span="4">
              <!-- 市 -->
              <Select v-model="MailingAddress.shi" @on-change="shiIndex(MailingAddress.shi)" placeholder="请选择市" :disabled='viewOnly'>
                <Option v-for="(item, index) in MailingAddress.shiList" :value="item.name" :key="index">
                  {{item.name}}
                </Option>
              </Select>
              </Col>
              <Col span="4">
              <!-- 县城 -->
              <Select v-model="MailingAddress.xian" placeholder="请选择区县" @on-change='showPost' :disabled='viewOnly'>
                <Option v-for="(item,index) in MailingAddress.xianList" :value="item" :key="index">
                  {{item}}
                </Option>
              </Select>
              </Col>
              <Col span="8" offset="2">
              <Input v-model="MailingAddress.detailedAddress" type="textarea" :autosize="true" placeholder="请输入详细地址" class='inputTextLeft' :disabled='viewOnly' />
              </Col>
            </Row>
          </td>
        </tr>

        <tr>
          <td>
            <Icon type="ios-medical" color="#ff6868" />
            联系电话
          </td>
          <td>
            <FormItem prop="TelNumber">
              <Input v-model="info.TelNumber" class='inputTextLeft' placeholder='请输入联系电话' :disabled='viewOnly'></Input>
            </FormItem>   
            <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'telnumberName')" v-if='telnumberNameList.length>0'/>
            <Oldname v-if="telnumberName" :oldName="telnumberNameList"></Oldname>        
          </td>
          <td>
            邮政编码
          </td>
          <td>
            <FormItem prop='MailZipCode'>
              <Input v-model="info.MailZipCode" :disabled='viewOnly'></Input>
            </FormItem>
          </td>
        </tr>

        <tr>
          <td width="25%">
            <Icon type="ios-medical" color="#ff6868" />
            建设地点
          </td>
          <td colspan="3">
            <Row>
              <Col span="4">
              <!-- 字段没对照 -->
              <FormItem prop="BuildAddress_shengA">
                <Select v-model="info.BuildAddress_shengA" @on-change="buildProvince" placeholder="请选择省" :disabled='viewOnly'>
                  <Option v-for="(item, index) in provinceLevel" :value="item.name" :key="index">
                    {{item.name}}
                  </Option>
                </Select>
              </FormItem>
              </Col>
              <Col span="4">
              <FormItem prop="BuildAddress_shiA">
                <Select v-model="info.BuildAddress_shiA" @on-change="buildCity" placeholder="请选择市" :disabled='viewOnly'>
                  <Option v-for="(item,index) in cityLevel" :value="item.name" :key="index">
                    {{item.name}}
                  </Option>
                </Select>
              </FormItem>
              </Col>
              <Col span="4">
              <FormItem prop="BuildAddress_xianA">
                <Select v-model="info.BuildAddress_xianA" placeholder="请选择区县" :disabled='viewOnly'>
                  <Option v-for="(item,index) in countyLevel" :value="item" :key="index">
                    {{item}}
                  </Option>
                </Select>
              </FormItem>
              </Col>
              <Col span="8" offset="2">
              <FormItem prop="BuildAddress_detailedA">
                <Input v-model="info.BuildAddress_detailedA" type="textarea" :autosize="true" placeholder="详细地址" class='inputTextLeft' :disabled='viewOnly'></Input>
              </FormItem>
              </Col>
            </Row>
          </td>
        </tr>

        <tr>
          <td width="25%">
            <Icon type="ios-medical" color="#ff6868" />
            建设性质
          </td>
          <td colspan="3">
            <FormItem prop="BulidProperty">
              <RadioGroup v-model="info.BulidProperty">
                <Radio label="新建" :disabled='viewOnly'>
                  <span>新建</span>
                </Radio>
                <Radio label="改扩建" :disabled='viewOnly'>
                  <span>改扩建</span>
                </Radio>
                <Radio label="技改" :disabled='viewOnly'>
                  <span>技改</span>
                </Radio>
              </RadioGroup>
            </FormItem>
          </td>
        </tr>

        <tr>
          <td width="25%">
            占地面积(平方米)
          </td>
          <td width="25%">
            <FormItem prop="FloorSpace">
              <Input v-model="info.FloorSpace" :disabled='viewOnly'></Input>
            </FormItem>
          </td>
          <td width="25%">
            绿化面积(平方米)
          </td>
          <td>
            <FormItem prop="GreenSpace">
              <Input v-model="info.GreenSpace" :disabled='viewOnly'></Input>
            </FormItem>
          </td>
        </tr>

        <tr>
          <td width="25%">
            总投资(万元)
          </td>
          <td width="25%">
            <FormItem prop="TotalInvestment">
              <Input v-model="info.TotalInvestment" :disabled='viewOnly'></Input>
            </FormItem>
          </td>
          <td width="25%">
            环评合同额（万元）
          </td>
          <td>
            <FormItem prop="ContractAmount">
              <Input v-model="info.ContractAmount" :disabled='viewOnly'></Input>
            </FormItem>
          </td>
        </tr>

        <tr>
          <td width="25%">
            产品名称
          </td>
          <td width="25%">
            <FormItem prop="ProductName">
              <Input v-model="info.ProductName" :disabled='viewOnly'></Input>
            </FormItem>
          </td>
          <td width="25%">
            生产规模
          </td>
          <td>
            <FormItem prop="ProductionScale">
              <Input type='textarea' :autosize="true" v-model="info.ProductionScale" :disabled='viewOnly' class='inputTextLeft'></Input>
            </FormItem>
          </td>
        </tr>

      </table>
    </Form>
    <Row style="padding:20px 0">
      <Col span="4">
      <PrintButton v-if="flag" Url="print/printProject" :Project_id="info.Id"></PrintButton>
      <!-- <PrintButton Url="print/printProject" :Project_id="info.Id"></PrintButton> -->
      </Col>
      <Col span="20" style="text-align:right">
      <Button type="primary" @click="submit('save')" :disabled='viewOnly'>保存</Button>
      <Button @click="submit('submit')" type="primary" :disabled='viewOnly'>提交</Button>
      </Col>
    </Row>
    <StepBar :current="0" :viewOnly='viewOnly'/>
  </Card>
</template>
<script>
import cityList from "../../../libs/city.js";
export default {
  inject: ['reload'],
  data() {
    // 手机号验证
    const validatePhone = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("联系电话不能为空"));
      } else if (!/^((0\d{2,3}-\d{7,8})|(1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}))$/.test(value)) {
        callback(new Error("电话格式不正确"));
      } else {
        callback();
      }
    };
    // 邮编验证
    const validateMailCode = (rule, value, callback) => {
      if (!value) {
        callback();
      } else if (value) {
        if (!/^[0-9][0-9]{5}$/.test(value)) {
          callback(new Error("邮编格式不正确"));
        } else {
          callback();
        }
      }
    };
    const validateNum = (rule, value, callback) => {
      if (value) {
        if (!/^\d+(?=\.{0,1}\d+$|$)/.test(value)) {
          callback(new Error('请输入数字'));
        }else{
          return callback()
        }
      }else{
        return callback()
      }
    }
    // 项目名字验重
    const validateProjectName = (rule, value, callback) => {
      if(value) {
        value=value.trim()
      }
      if(!value) {
        callback(new Error('项目名称不能为空'))
      }else {
        // axios.post('/projectInformation/getProjectName',{Project_name: this.info.Project_name}).then(res=>{
        axios.post('/projectInformation/getProjectName',{ProjectName: this.info.ProjectName , ProjectId: this.info.Id}).then(res=>{
          console.log(res)
          if(res._STATUS == 1) {
            callback()
          }else {
            callback(new Error(res._MESSAGE))
          }  
        }).catch(err=>{
          console.log(err)
        })
      }
    }
    return {
      isCustomInput: false, // 自定义输入编号
      // 项目名称、建设单位、法人、联系人、联系电话留痕列表
      projectName: false,
      buildName: false,
      LegalPerson: false,
      Linkman: false,
      telnumberName: false,
      projectNameList: [], 
      buildNameList: [],  
      LegalPersonList: [],       
      LinkmanList: [],
      telnumberNameList: [],
      modal8: false,
      viewOnly: false,   //允许修改
      hackReset: true,  //  刷新组件
      // 省级联动
      provinceLevel: cityList,
      cityLevel: [],
      countyLevel: [],
      province1: "北京市",
      city1: "北京市",
      county1: "朝阳区",
      flag: false,
      info: {
        Project_number: "加载中",
        BuildAddress_shengA: "",
        BuildAddress_shiA: "",
        BuildAddress_xianA: "",
        BuildAddress_detailedA: "",
        MailZipCode: ""
      },
      
      rules: {
        ProjectNumber: {
          required: true,
          trigger: "blur",
          message: "项目编号不能为空"
        },
        // Projectnumg:[
        //   {validator: validateProjectNameg, trigger: 'blur'}
        // ],
        ProjectName: [
          {validator: validateProjectName, trigger: 'blur'}
        ],
        BuildUnit: {
          required: true,
          trigger: "blur",
          message: "建设单位不能为空"
        },
        Linkman: {
          required: true,
          trigger: "blur",
          message: "联系人不能为空"
        },
        TelNumber: [
          { validator: validatePhone, trigger: "blur" }
        ],
        MailZipCode: [
          { validator: validateMailCode, trigger: "blur" }
        ],
        FloorSpace: [
          { validator: validateNum, trigger: 'blur' }
        ],
        GreenSpace: [
          { validator: validateNum, trigger: 'blur' }
        ],
        TotalInvestment: [
          { validator: validateNum, trigger: 'blur' }
        ],
        ContractAmount: [
          { validator: validateNum, trigger: 'blur' }
        ],
        BulidProperty: {
          required: true,
          trigger: "change",
          message: "建设性质不能为空"
        },
        BuildAddress_shiA: {
          required: true,
          trigger: "change",
          message: " "
        },
        BuildAddress_shengA: {
          required: true,
          trigger: "change",
          message: " "
        },
        BuildAddress_xianA: {
          required: true,
          trigger: "change",
          message: " "
        },
        BuildAddress_detailedA: {
          required: true,
          trigger: "blur",
          message: "详细地址不能为空"
        }
      },
      MailingAddress: {
        selectsheng: cityList,
        shiList: {},
        xianList: {},
        detailedAddress: null,
        sheng: null,
        shi: null,
        xian: null
      },
      updatedInfo: 0,
      setButton: 0,
    };
  },
  watch: {
    // 通讯地址
    "MailingAddress.sheng"() {
      this.shengIndex(this.MailingAddress.sheng, true);
    },
    "MailingAddress.shi"() {
      this.shiIndex(this.MailingAddress.shi, true);
    },
    // 建设地点
    "info.BuildAddress_shengA"() {
      this.buildProvince(this.info.BuildAddress_shengA, true);
    },
    "info.BuildAddress_shiA"() {
      this.buildCity(this.info.BuildAddress_shiA, true);
    },
    $route(){
      this.$router.push({
        name: 'blackPage',
        query: {
          type: 0
        }
      })
    }
  },
  mounted() {
    if (this.$route.query.ProjectId) {
      this.getProject(this.$route.query.ProjectId);
      if(this.$route.query.viewOnly==1 || localStorage.getItem('userOrg') ==7) {
        this.viewOnly = true
      }
    } else {
      this.getItemNumber();
    }
    this.projectNumRule()
  },
  methods: {
    // 编号规则
    projectNumRule() {
      axios.post('branch/findNumberType').then((res)=>{    
        if(res._STATUS ==1) {
          if(res.isTrue==3) {
            this.isCustomInput = true
          } 
        }
      }).catch((err)=>{
          console.log(err)
      })
    },
    // 名字去重显示
    viewClick(e,nameShow) {
      if(!this[nameShow]) {
        e.target.className = 'ivu-icon ivu-icon-ios-arrow-up'
      }else {
        e.target.className = 'ivu-icon ivu-icon-ios-arrow-down'
      }
      this[nameShow] = !this[nameShow]
    },
    // 建设地点 省级联动
    buildProvince(value, clear) {
      if (!clear) {
        this.info.BuildAddress_shiA = "";
        this.info.BuildAddress_xianA = "";
      }
      for (var i = 0; i < this.provinceLevel.length; i++) {
        if (value == this.provinceLevel[i].name) {
          this.cityLevel = this.provinceLevel[i].cityList;
        }
      }
    },
    buildCity(value, clear) {
      if (!clear) {
        this.info.BuildAddress_xianA = "";
      }
      for (var i = 0; i < this.cityLevel.length; i++) {
        if (value == this.cityLevel[i].name) {
          this.countyLevel = this.cityLevel[i].areaList;
        }
      }
    },
    // 通讯地址 自动显示邮编
    showPost(val) {
      if (val) {
        var data = {
          Province: this.MailingAddress.sheng,
          City: this.MailingAddress.shi,
          Area: val
        };
        axios
          .post("/provinceCityArea/findCode", data)
          .then(res => {
            if (res._STATUS == 1) {
              this.info.MailZipCode = res.Code;
            }
          })
          .catch(err => {
            console.log(err);
          });
      }
    },
    getItemNumber() {
      axios.get("/projectInformation/getProjectNumber").then(res => {
        if(res._STATUS==1) {
          this.info.ProjectNumber = res.ProjectNumber;
          localStorage.projectType = 0;
          console.log(res.ProjectNumber)
          this.flag = true;
        }else {
          this.$Modal.error({
            title: '提示',
            content: res._MESSAGE,
            onOk:()=>{
              this.$router.push({name: 'userHeartData'})
            }
          })
        }
      });
    },
    // 保存 save / 提交 submit
    submit(type) {
      // 验证
      // if(this.setButton == 0){ 
      //     this.setButton = 1
      //   setTimeout(()=>{this.setButton = 0},60000)
        this.$refs.form.validate(valid => {
        if (!valid) {
          return;
        }
        let info = this.info,
          MailingAddress = this.MailingAddress;
        // if(this.updatedInfo <= 1){
        //   this.$Message.warning('未修改数据无法提交')
        //   return
        // }
        info.BtnWay = type == "save" ? 1 : 2;
        info.PerjectType = type == "save" ? 1 : 1;
        // 通讯地址
        info.MailAddress = [
          MailingAddress.sheng,
          MailingAddress.shi,
          MailingAddress.xian,
          MailingAddress.detailedAddress
        ].join("--");

        // 建设地点
        info.BuildAddress = [
          info.BuildAddress_shengA,
          info.BuildAddress_shiA,
          info.BuildAddress_xianA,
          info.BuildAddress_detailedA
        ].join("--");
        // console.log(info)
        // debugger
        if(type == 'save'){         //保存
          if(this.setButton == 0){
            this.setButton = 1
            setTimeout(()=>{this.setButton = 0},60000)
          }else{
            this.$Message.warning('连续点击保存时间过短，最少间隔1分钟!')
            return
          }
        }else if(type == 'submit'){                      //提交
          if(this.$route.query.ProjectId && localStorage.getItem('projectType') == 1 && this.info.IsAssign == 0){
            this.$Modal.confirm({
              title: '修改信息',
              content: '请勿重复提交，该项目已提交至项目分配环节。请确定是否修改了表格内容，需要再次提交信息？',
              okText: '修改',
              onOk: ()=>{
                axios.post('/projectInformation/saveOrUpdateProject',info).then(res=>{
                  console.log(res)
                  if(res._MESSAGE == "保存项目成功"){
                    this.$Message.success(res._MESSAGE)
                  }else if(res._MESSAGE == "项目已提交，等待分配"){
                    this.$Message.success(res._MESSAGE)
                  }else if(res._MESSAGE == "无权限进行此操作"){
                    this.$Message.warning(res._MESSAGE)
                  }
                }).catch((err)=>{return})
              },
              onCancel: ()=>{
                return 
              }
            })
            return
          }
        }
        axios.post("/projectInformation/saveOrUpdateProject", info).then(res => {
            // console.log(res)
            let title = res._MESSAGE;
            if (res._STATUS == 1) {
              if (type == "save") {
                this.$Modal.success({
                  title
                });
                this.$router.push({name: 'underway'})
              } else {
                if (typeof this.info.IsAssign == "undefined" || this.info.IsAssign == null) {
                  console.log(this.info)
                  if(this.info.PerjectType == 1 && info.IsAssign == null){
                    axios.get('member/findByMembers').then((res)=>{
                      var members = res.members
                      if(!(members==null||members=="")) {
                        social({
                          method: 'post',
                          url: '/info/notice',
                          params: {
                            content: this.info.ProjectName + '项目已创建提交，请尽快进行项目分配！',
                            app_name: '环评管控系统',
                            app: 'eao',
                            type: members,
                            uid: -1
                          },
                        })
                      }
                    }).catch((err)=>{
                      console.log(err)
                    })
                  }
                  this.$Modal.success({
                    title: res._MESSAGE,
                    onOk: () => {
                      this.$router.push({name: 'underway'})
                    } 
                  });
                } else {
                  this.$Modal.success({
                    // title: "分配完已完成"
                    title: res._MESSAGE
                  });
                }
              }
            } else {
              // 提示
              this.$Modal.error({
                title:res._MESSAGE
              });
            }
          })
          .catch(err => {
            console.log(err)
            this.$Message.error('请求失败')
            // alert("请求崩溃");
          });
      });
      // }else{
      //   this.$Message.warning('请勿重复提交!')
      // }
      
    },
    // 获取市
    shengIndex(shengName, clear) {
      if (!clear) {
        this.MailingAddress.shi = "";
        this.MailingAddress.xian = "";
        this.info.MailZipCode = "";
      }
      let selectsheng = this.MailingAddress.selectsheng;
      for (let i = 0; i < Object.keys(selectsheng).length; i++) {
        if (selectsheng[i].name == shengName) {
          this.MailingAddress.shiList = selectsheng[i].cityList;
        }
      }
    },
    //获区
    shiIndex(cityName, clear) {
      if (!clear) {
        this.MailingAddress.xian = "";
      }
      let selectShi = this.MailingAddress.shiList;
      for (let i = 0; i < Object.keys(selectShi).length; i++) {
        if (selectShi[i].name == cityName) {
          this.MailingAddress.xianList = selectShi[i].areaList;
        }
      }
    },
    /* 获取当前创建项目 */
    getProject(Id) {
      this.$post('ProjectInfo.findProjectByID', {
        Id
      }).then(res => {
          if (res._STATUS == 1) {
            this.info = res.info
            console.log(res)
            var buildAddress = res.info.BuildAddress.split("--");
            this.info.BuildAddress_shengA = buildAddress[0];
            this.info.BuildAddress_shiA = buildAddress[1];
            this.info.BuildAddress_xianA = buildAddress[2];
            this.info.BuildAddress_detailedA = buildAddress[3];
            var mailingAddress = res.info.MailAddress.split("--");
            this.MailingAddress.sheng = mailingAddress[0];
            this.MailingAddress.shi = mailingAddress[1];
            this.MailingAddress.xian = mailingAddress[2];
            this.MailingAddress.detailedAddress = mailingAddress[3];
            localStorage.projectType = this.info.PerjectType;
            this.flag = true;
            if(res.pt2List.length>0) {
              var arrAll = res.pt2List //所有更改记录
              function arrayUnique2(arr, ProjectName) {
                var hash = {};
                return arr.reduce(function (item, next) {
                  hash[next[ProjectName]] ? '' : hash[next[ProjectName]] = true && item.push(next);
                  return item;
                }, []);
              }
              var projectNameList = arrayUnique2(arrAll, "ProjectName")
              if(projectNameList[0].ProjectName==this.info.ProjectName) {
                projectNameList = arrayUnique2(arrAll, "ProjectName").slice(1)
              }
              projectNameList.forEach(e => {
                this.projectNameList.push({name: e.ProjectName,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });

              var buildNameList = arrayUnique2(arrAll, "BuildUnit")
              if(buildNameList[0].BuildUnit==this.info.BuildUnit) {
                buildNameList = arrayUnique2(arrAll, "BuildUnit").slice(1)
              }
              buildNameList.forEach(e => {
                this.buildNameList.push({name: e.BuildUnit,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });

              var LegalPersonList = arrayUnique2(arrAll, "LegalPerson")
              if(LegalPersonList[0].LegalPerson==this.info.LegalPerson) {
                LegalPersonList = arrayUnique2(arrAll, "LegalPerson").slice(1)
              }
              LegalPersonList.forEach(e => {
                this.LegalPersonList.push({name: e.LegalPerson,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });
              
              var LinkmanList =  arrayUnique2(arrAll, "Linkman")
              if(LinkmanList[0].Linkman==this.info.Linkman) {
                LinkmanList =  arrayUnique2(arrAll, "Linkman").slice(1)
              }
              LinkmanList.forEach(e => {
                this.LinkmanList.push({name: e.Linkman,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });

              var telnumberNameList = arrayUnique2(arrAll, "TelNumber")
              if(telnumberNameList[0].TelNumber==this.info.TelNumber) {
                telnumberNameList = arrayUnique2(arrAll, "TelNumber").slice(1)
              }
              telnumberNameList.forEach(e => {
                this.telnumberNameList.push({name: e.TelNumber,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });      
            }
          } else {
            this.$Message.error(res._MESSAGE)
          }
        })
        .catch(err => {
          console.log(err);
        });
    }
  },
};
</script>
<style lang="less">
.ivu-form-item {
  margin-bottom: 0 !important;
}

#createProgram {
  .inputTextLeft {
    textarea.ivu-input {
      font-size: 12px;
    }
    .ivu-input {
      border: none !important;
      text-align: center;
      // height: 30px;
      input {
        outline: medium;
      }
    }
  }
  textarea.ivu-input {
    font-size: 12px;
  }
  .ivu-input {
    border: none !important;
    text-align: center;
    // height: 30px;
    input {
      outline: medium;
    }
  }
  .ivu-col-span-4 {
    margin-left: 10px;
  }
  .ivu-col-offset-2 {
    border: 1px solid #eee;
    border-radius: 4px;
  }
  .ivu-form-item-error-tip {
    line-height: 0.5;
    padding: 0;
  }
  .ivu-input[disabled], fieldset[disabled] .ivu-input {
    background-color: #fff; 
    color: #333;
    font-size:12px; 
  }
  .ivu-select-disabled .ivu-select-selection {
    background-color: #fff;
    color: #333;
    border: 0;
  }
}
</style>